package com.eugene.element;

import com.eugene.enums.EResultType;

public class FnMeasure {
	/**
	 * @uml.property  name="baseDate"
	 * @uml.associationEnd  
	 */
	private FnCalendar baseDate;
	/**
	 * @uml.property  name="fnProdId"
	 */
	private String fnProdId;
	
	/**
	 * @uml.property  name="residualTerm"
	 */
	private double residualTerm;			   
	/**
	 * @uml.property  name="accruedInterest"
	 */
	private double accruedInterest;		   
	/**
	 * @uml.property  name="spotPrice"
	 */
	private double spotPrice; 				   
	/**
	 * @uml.property  name="pv"
	 */
	private double pv;								   
	/**
	 * @uml.property  name="dirtyPrice"
	 */
	private double dirtyPrice; 			   
	/**
	 * @uml.property  name="cleanPrice"
	 */
	private double cleanPrice;				   
	/**
	 * @uml.property  name="yield"
	 */
	private double yield;						   
	/**
	 * @uml.property  name="spreadOverYield"
	 */
	private double spreadOverYield;	   
	/**
	 * @uml.property  name="macaulayDuration"
	 */
	private double macaulayDuration;	   
	/**
	 * @uml.property  name="adjustedDuration"
	 */
	private double adjustedDuration;	   
	/**
	 * @uml.property  name="effectiveDuration"
	 */
	private double effectiveDuration;   
	/**
	 * @uml.property  name="convexity"
	 */
	private double convexity;				   
	/**
	 * @uml.property  name="effectiveConvexity"
	 */
	private double effectiveConvexity;  
	/**
	 * @uml.property  name="impliedSpread"
	 */
	private double impliedSpread;		   
	/**
	 * @uml.property  name="impliedVolatility"
	 */
	private double impliedVolatility;   
	/**
	 * @uml.property  name="pv01"
	 */
	private double pv01;							   
	/**
	 * @uml.property  name="delta"
	 */
	private double delta;						   
	/**
	 * @uml.property  name="gamma"
	 */
	private double gamma;						   
	/**
	 * @uml.property  name="vega"
	 */
	private double vega	;						   
	/**
	 * @uml.property  name="theta"
	 */
	private double theta;						   
	/**
	 * @uml.property  name="domesticRho"
	 */
	private double domesticRho;			   
	/**
	 * @uml.property  name="foreignRho"
	 */
	private double foreignRho;				   
	/**
	 * @uml.property  name="exposure"
	 */
	private double exposure;					   
	/**
	 * @uml.property  name="beta"
	 */
	private double beta;							   
	/**
	 * @uml.property  name="basis"
	 */
	private double basis; 		
	
	public FnMeasure(){
		
	}
	public FnMeasure(FnCalendar baseDate){
		this.baseDate = baseDate;
	}
	
	/**
	 * @return
	 * @uml.property  name="baseDate"
	 */
	public FnCalendar getBaseDate() {
		return baseDate;
	}

	/**
	 * @param baseDate
	 * @uml.property  name="baseDate"
	 */
	public void setBaseDate(FnCalendar baseDate) {
		this.baseDate = baseDate;
	}

	/**
	 * @return
	 * @uml.property  name="fnProdId"
	 */
	public String getFnProdId() {
		return fnProdId;
	}

	/**
	 * @param fnProdId
	 * @uml.property  name="fnProdId"
	 */
	public void setFnProdId(String fnProdId) {
		this.fnProdId = fnProdId;
	}

	/**
	 * @return
	 * @uml.property  name="residualTerm"
	 */
	public double getResidualTerm() {
		return residualTerm;
	}

	/**
	 * @param residualTerm
	 * @uml.property  name="residualTerm"
	 */
	public void setResidualTerm(double residualTerm) {
		this.residualTerm = residualTerm;
	}

	/**
	 * @return
	 * @uml.property  name="accruedInterest"
	 */
	public double getAccruedInterest() {
		return accruedInterest;
	}

	/**
	 * @param accruedInterest
	 * @uml.property  name="accruedInterest"
	 */
	public void setAccruedInterest(double accruedInterest) {
		this.accruedInterest = accruedInterest;
	}

	/**
	 * @return
	 * @uml.property  name="spotPrice"
	 */
	public double getSpotPrice() {
		return spotPrice;
	}

	/**
	 * @param spotPrice
	 * @uml.property  name="spotPrice"
	 */
	public void setSpotPrice(double spotPrice) {
		this.spotPrice = spotPrice;
	}

	/**
	 * @return
	 * @uml.property  name="pv"
	 */
	public double getPv() {
		return pv;
	}

	/**
	 * @param pv
	 * @uml.property  name="pv"
	 */
	public void setPv(double pv) {
		this.pv = pv;
	}

	/**
	 * @return
	 * @uml.property  name="dirtyPrice"
	 */
	public double getDirtyPrice() {
		return dirtyPrice;
	}

	/**
	 * @param dirtyPrice
	 * @uml.property  name="dirtyPrice"
	 */
	public void setDirtyPrice(double dirtyPrice) {
		this.dirtyPrice = dirtyPrice;
	}

	/**
	 * @return
	 * @uml.property  name="cleanPrice"
	 */
	public double getCleanPrice() {
		return cleanPrice;
	}

	/**
	 * @param cleanPrice
	 * @uml.property  name="cleanPrice"
	 */
	public void setCleanPrice(double cleanPrice) {
		this.cleanPrice = cleanPrice;
	}

	/**
	 * @return
	 * @uml.property  name="yield"
	 */
	public double getYield() {
		return yield;
	}

	/**
	 * @param yield
	 * @uml.property  name="yield"
	 */
	public void setYield(double yield) {
		this.yield = yield;
	}

	/**
	 * @return
	 * @uml.property  name="spreadOverYield"
	 */
	public double getSpreadOverYield() {
		return spreadOverYield;
	}

	/**
	 * @param spreadOverYield
	 * @uml.property  name="spreadOverYield"
	 */
	public void setSpreadOverYield(double spreadOverYield) {
		this.spreadOverYield = spreadOverYield;
	}

	/**
	 * @return
	 * @uml.property  name="macaulayDuration"
	 */
	public double getMacaulayDuration() {
		return macaulayDuration;
	}

	/**
	 * @param macaulayDuration
	 * @uml.property  name="macaulayDuration"
	 */
	public void setMacaulayDuration(double macaulayDuration) {
		this.macaulayDuration = macaulayDuration;
	}

	/**
	 * @return
	 * @uml.property  name="adjustedDuration"
	 */
	public double getAdjustedDuration() {
		return adjustedDuration;
	}

	/**
	 * @param adjustedDuration
	 * @uml.property  name="adjustedDuration"
	 */
	public void setAdjustedDuration(double adjustedDuration) {
		this.adjustedDuration = adjustedDuration;
	}

	/**
	 * @return
	 * @uml.property  name="effectiveDuration"
	 */
	public double getEffectiveDuration() {
		return effectiveDuration;
	}

	/**
	 * @param effectiveDuration
	 * @uml.property  name="effectiveDuration"
	 */
	public void setEffectiveDuration(double effectiveDuration) {
		this.effectiveDuration = effectiveDuration;
	}

	/**
	 * @return
	 * @uml.property  name="convexity"
	 */
	public double getConvexity() {
		return convexity;
	}

	/**
	 * @param convexity
	 * @uml.property  name="convexity"
	 */
	public void setConvexity(double convexity) {
		this.convexity = convexity;
	}

	/**
	 * @return
	 * @uml.property  name="effectiveConvexity"
	 */
	public double getEffectiveConvexity() {
		return effectiveConvexity;
	}

	/**
	 * @param effectiveConvexity
	 * @uml.property  name="effectiveConvexity"
	 */
	public void setEffectiveConvexity(double effectiveConvexity) {
		this.effectiveConvexity = effectiveConvexity;
	}

	/**
	 * @return
	 * @uml.property  name="impliedSpread"
	 */
	public double getImpliedSpread() {
		return impliedSpread;
	}

	/**
	 * @param impliedSpread
	 * @uml.property  name="impliedSpread"
	 */
	public void setImpliedSpread(double impliedSpread) {
		this.impliedSpread = impliedSpread;
	}

	/**
	 * @return
	 * @uml.property  name="impliedVolatility"
	 */
	public double getImpliedVolatility() {
		return impliedVolatility;
	}

	/**
	 * @param impliedVolatility
	 * @uml.property  name="impliedVolatility"
	 */
	public void setImpliedVolatility(double impliedVolatility) {
		this.impliedVolatility = impliedVolatility;
	}

	/**
	 * @return
	 * @uml.property  name="pv01"
	 */
	public double getPv01() {
		return pv01;
	}

	/**
	 * @param pv01
	 * @uml.property  name="pv01"
	 */
	public void setPv01(double pv01) {
		this.pv01 = pv01;
	}

	/**
	 * @return
	 * @uml.property  name="delta"
	 */
	public double getDelta() {
		return delta;
	}

	/**
	 * @param delta
	 * @uml.property  name="delta"
	 */
	public void setDelta(double delta) {
		this.delta = delta;
	}

	/**
	 * @return
	 * @uml.property  name="gamma"
	 */
	public double getGamma() {
		return gamma;
	}

	/**
	 * @param gamma
	 * @uml.property  name="gamma"
	 */
	public void setGamma(double gamma) {
		this.gamma = gamma;
	}

	/**
	 * @return
	 * @uml.property  name="vega"
	 */
	public double getVega() {
		return vega;
	}

	/**
	 * @param vega
	 * @uml.property  name="vega"
	 */
	public void setVega(double vega) {
		this.vega = vega;
	}

	/**
	 * @return
	 * @uml.property  name="theta"
	 */
	public double getTheta() {
		return theta;
	}

	/**
	 * @param theta
	 * @uml.property  name="theta"
	 */
	public void setTheta(double theta) {
		this.theta = theta;
	}

	/**
	 * @return
	 * @uml.property  name="domesticRho"
	 */
	public double getDomesticRho() {
		return domesticRho;
	}

	/**
	 * @param domesticRho
	 * @uml.property  name="domesticRho"
	 */
	public void setDomesticRho(double domesticRho) {
		this.domesticRho = domesticRho;
	}

	/**
	 * @return
	 * @uml.property  name="foreignRho"
	 */
	public double getForeignRho() {
		return foreignRho;
	}

	/**
	 * @param foreignRho
	 * @uml.property  name="foreignRho"
	 */
	public void setForeignRho(double foreignRho) {
		this.foreignRho = foreignRho;
	}

	/**
	 * @return
	 * @uml.property  name="exposure"
	 */
	public double getExposure() {
		return exposure;
	}

	/**
	 * @param exposure
	 * @uml.property  name="exposure"
	 */
	public void setExposure(double exposure) {
		this.exposure = exposure;
	}

	/**
	 * @return
	 * @uml.property  name="beta"
	 */
	public double getBeta() {
		return beta;
	}

	/**
	 * @param beta
	 * @uml.property  name="beta"
	 */
	public void setBeta(double beta) {
		this.beta = beta;
	}

	/**
	 * @return
	 * @uml.property  name="basis"
	 */
	public double getBasis() {
		return basis;
	}

	/**
	 * @param basis
	 * @uml.property  name="basis"
	 */
	public void setBasis(double basis) {
		this.basis = basis;
	}
//*****************End of Getter and Setter**************************
	
	public void setFnMeasure(EResultType rstType, double rst){
		switch (rstType){
		case RESIDUAL_TERM		:setResidualTerm(rst);			break;
		case ACCRUED_INTEREST	:setAccruedInterest(rst);		break;
		case SPOT_PRICE 		:setSpotPrice(rst);				break;
		case PV					:setPv(rst);					break;
		case DIRTY_PRICE 		:setDirtyPrice(rst);			break;
		case CLEAN_PRICE		:setCleanPrice(rst);			break;
		case YIELD				:setYield(rst);					break;
		case SPREAD_OVER_YIELD	:setSpreadOverYield(rst);		break;
		case MACAULAY_DURATION	:setMacaulayDuration(rst);		break;
		case ADJUSTED_DURATION	:setAdjustedDuration(rst);		break;
		case EFFECTIVE_DURATION	:setEffectiveDuration(rst);		break;
		case CONVEXITY			:setConvexity(rst);				break;
		case EFFECTIVE_CONVEXITY:setEffectiveConvexity(rst);	break;
		case IMPLIED_SPREAD		:setImpliedSpread(rst);			break;
		case IMPLIED_VOLATILITY	:setImpliedVolatility(rst);		break;
		case PV01				:setPv01(rst);					break;
		case DELTA				:setDelta(rst);					break;
		case GAMMA				:setGamma(rst);					break;
		case VEGA				:setVega(rst);					break;
		case THETA				:setTheta(rst);					break;
		case DOMESTIC_RHO		:setDomesticRho(rst);			break;
		case FOREIGN_RHO		:setForeignRho(rst);			break;
		case EXPOSURE			:setExposure(rst);				break;
		case BETA				:setBeta(rst);					break;
		case BASIS 				:setBasis(rst);					break;
		}
	}
	public double getFnMeasure(EResultType rstType){                        
		switch (rstType){                                                      
		case RESIDUAL_TERM		:return getResidualTerm();		                
		case ACCRUED_INTEREST	:return getAccruedInterest();	                  
		case SPOT_PRICE 		:return getSpotPrice();			                  
		case PV					:return getPv();				                            
		case DIRTY_PRICE 		:return getDirtyPrice();		                    
		case CLEAN_PRICE		:return getCleanPrice();		                    
		case YIELD				:return getYield();				                      
		case SPREAD_OVER_YIELD	:return getSpreadOverYield();	            
		case MACAULAY_DURATION	:return getMacaulayDuration();	            
		case ADJUSTED_DURATION	:return getAdjustedDuration();	            
		case EFFECTIVE_DURATION	:return getEffectiveDuration();	          
		case CONVEXITY			:return getConvexity();			                  
		case EFFECTIVE_CONVEXITY:return getEffectiveConvexity();            
		case IMPLIED_SPREAD		:return getImpliedSpread();		              
		case IMPLIED_VOLATILITY	:return getImpliedVolatility();	          
		case PV01				:return getPv01();				                          
		case DELTA				:return getDelta();				                      
		case GAMMA				:return getGamma();				                      
		case VEGA				:return getVega();				                          
		case THETA				:return getTheta();				                      
		case DOMESTIC_RHO		:return getDomesticRho();		                  
		case FOREIGN_RHO		:return getForeignRho();		                    
		case EXPOSURE			:return getExposure();			                      
		case BETA				:return getBeta();				                          
		case BASIS 				:return getBasis();		
		default 				:return 0.0; 
		}                  
		                                               
	}                                                                     


}
